-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Numerics serialization #20222
Numerics serialization #20222
Conversation
…vetently dropped in the previous cleanup. Also renames the private fields of Complex to match NetFX so that it will be serialization compatible.
|
CC @danmosemsft @dotnet/corert-contrib |
| _real = real; | ||
| _imaginary = imaginary; | ||
| m_real = real; | ||
| m_imaginary = imaginary; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we going to commentthat field names must not change, ornot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 Assuming the upcoming test covers it, I wouldn't think the comment would be necessary. Seems like adding the comments is prone to a situation where one or more comments is omitted, and a reader incorrectly infers that the lack of a comment means the name can change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer we add comments. I understand @sharwell's point, but at the same time, seeing a comment and avoiding a change entirely is a lot quicker than having to figure out why a test is failing, can be spotted in code reviews, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something inline like
m_real = real; // Do not rename (binary serialization)
m_imaginary = imaginary; // Do not rename (binary serialization)We already do stuff like this in types that are hard bound to the runtime eg on string and array, although I guess there will be many more like this.
Your call @morganbr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll go ahead with those comments in this change, but leave the overall process to @ViktorHofer and @krwq when they handle all of the other types.
Adds serialization support to BigInteger and Complex, which were inadvetently dropped in the previous cleanup. Also renames the private fields of Complex to match NetFX so that it will be serialization compatible.
Adds serialization support to BigInteger and Complex, which were inadvetently dropped in the previous cleanup. Also renames the private fields of Complex to match NetFX so that it will be serialization compatible.
It seems that serialization support for `Complex` in `System.Runtime.Numerics` got cleaned up a while ago. It is scheduled for reintroduction in `netstandard2.1`. See the following PR for more info: dotnet/corefx#20222
It seems that serialization support for `Complex` in `System.Runtime.Numerics` got cleaned up a while ago. It is scheduled for reintroduction in `netstandard2.1`. See the following PR for more info: dotnet/corefx#20222
Adds serialization support to BigInteger and Complex, which were inadvertently dropped in the previous cleanup. Also renames the private fields of Complex to match NetFX so that it will be serialization compatible. Testing will be covered in an upcoming change by @ViktorHofer.
This is progress on #19119